<?php
session_start();
include("connect.php");
if($_SESSION['loget_in'] == 1) {
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>.::22Tirsdags rediger side::.</title>
<style type="text/css">
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background-color:#999;
}
.copyright {
font-family: Verdana, Geneva, sans-serif;
color: #FFF;
}
#login {
font-family: Verdana, Geneva, sans-serif;
font-size: 12px;
color: #020001;
}
</style>
</head>
<body>
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0" z-index="-1" background="bg.png">
<tr>
<td align="center" valign="top"><table width="840" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#FFFBF0" background="administration.png" height="93px" min-height="93px" max-height="93px"></td>
</tr>
<tr>
<td bgcolor="#D6D6D6" max-height="20px" min-height="20px" height="20px"><table width="840" height="20px" background="menubg.png" cellspacing="0" cellpadding="0">
<tr>
<td><?php
$siderquery = mysql_query("SELECT * FROM sider ORDER BY id ASC");
while($sidedata = mysql_fetch_assoc($siderquery))
{
print "| <a href=\"/?side=".$sidedata[url]."\">".$sidedata[overskrift]."</a> ";
}
?>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td bgcolor="#FFFBF0" valign="top">
<?php
if(isset($_GET['ret']) AND $_GET['id']) { // checker om $_GET['slet'] eksisterer
$id = $_GET['id'];
?>
<?PHP
$getfromid = mysql_query("SELECT * FROM sider ORDER BY id WHERE id = '$id'")or die(mysql_error());
while($select = mysql_fetch_array($getfromid)){
$id = $select[id];
$overskrift = $select[overskrift];
$indhold = $select[indhold];
$url = $select[url];
}
?>
<form action="?do=rediger" method="POST">
Overskrift:<br>
<input type="input" name="retoverskrift" value="<?PHP echo "$overskrift"; ?>><br>
Indhold:<br>
<textarea style="width:800px; height: 450px;" name="retindhold"><?PHP echo "$indhold"; ?></textarea><br>
URL: (fx: ?side=php)<br>
projekt.wizzo.dk/?side= <input type="input" name="returl" value="<?PHP echo "$url"; ?>><br>
<input type="submit" value="Rediger">
</form>
<?PHP
}
else
//{
//echo "<font color=red>Der er ikke fundet noget id...</font>";
//}
{
?>
<?
if($_GET['do'] == "rediger")
{
mysql_query("update sider set overskrift='$retoverskrift', indhold='$retindhold', url='$returl' WHERE id = '$id'") or die(mysql_error());
echo "<font color=green>Siden er blevet opdateret</font>";
}
else
{
echo "<font color=red>Siden er ikke blevet opdateret</font>";
}
?>
<?PHP
$resultat = mysql_query("select * FROM sider order by id desc"); // henter db info
while ($row = mysql_fetch_array($resultat)) { // viser info
echo "<br>";
echo "$row[overskrift]";
echo "<br>";
?>
<?
?>
<a href="retside.php?ret=<? echo "$row[id]" ?>">Ret</a><br>
<?
?>
<?php
}
}
?>
</td>
</tr>
<tr>
<td align="center" bgcolor="#2A9FAA" class="copyright">Copyright © 8. klasse projektuge. uge13. Andreas, Abbas, Mads L og Kristian  <div id="login"><?PHP
if($_SESSION['loget_in'] == 1){
?><?PHP echo $_SESSION[Username];?> <a href="admin.php">Admin siden</a> <a href="logud.php">Log ud</a></div><?PHP } ?></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
<?php
}
else
{
echo "Hvad med lige at logge ind...";
echo "<br>";
echo "<a href=adminlogin.php>Login her</a>";
}
?>
dte eneste jeg gerne vil have hjælp til er at få $_GET['id'] til at virke
fordi så skal jeg nok selv kunne lave resten